Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve Localization #9109

Merged
merged 13 commits into from
Aug 16, 2024
Merged

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Aug 8, 2024

Description

  • some improvements
  • add tests for the current behavior
  • refactor test

See #7960

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • User guide updated
  • [] Conforms to style guide

@kenjis kenjis added the documentation Pull requests for documentation only label Aug 8, 2024
@neznaika0
Copy link
Contributor

I would add a note about the keys. Something like this:

If you want to use whole phrases instead of short keys, be careful - each dot is considered an array separator. You will not be able to get the correct translation.

return [
    'Done. The email has been sent successfully.' => 'Done. The email has been sent successfully.'
];

@kenjis
Copy link
Member Author

kenjis commented Aug 9, 2024

@neznaika0 Added a note. 7e2ea39
and see the test code: 8319a3c

@kenjis kenjis force-pushed the docs-localization.rst branch from 3622fa8 to 2835cc4 Compare August 10, 2024 01:09
@kenjis
Copy link
Member Author

kenjis commented Aug 10, 2024

Added about missing Language locale: 3cb3839
See https://forum.codeigniter.com/showthread.php?tid=76017

@neznaika0
Copy link
Contributor

Good. I changing the language in the request (in Filters). It's the same solution.
$request->setLocale($settings->get('language'));

@kenjis kenjis merged commit 3e06557 into codeigniter4:develop Aug 16, 2024
42 checks passed
@kenjis kenjis deleted the docs-localization.rst branch August 16, 2024 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests for documentation only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants